package com.lfz.demo.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lfz.demo.dao.NoticeMapper;
import com.lfz.demo.entity.Notice;
import com.lfz.demo.repository.NoticeRepository;
import com.lfz.demo.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lfz
 * @date 2025/3/26 14:33
 */
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Autowired
    private NoticeRepository noticeRepository;
    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public Page<Notice> findByPage(Specification<Notice> spec, Pageable pageable) {
        return noticeRepository.findAll(spec, pageable);
    }

    @Override
    public List<Notice> listByStatusLimit3() {
        return noticeMapper.listByStatusLimit3();
    }

    @Override
    public List<Notice> partNoticeListDesc() {
        return noticeMapper.partNoticeListDesc();
    }
}
